import cn.com.firmlink.util.Localizator;

import flash.events.Event;

import mx.binding.utils.BindingUtils;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.rpc.remoting.mxml.RemoteObject;

private function initialParams():void
{
	BindingUtils.bindSetter(changeLang, this, "languageCode");
	getParams();

}

public function getParams():void
{
	var params:String;
	var o:Object=root.loaderInfo.parameters;

	languageCode=o["languageCode"];
}

private var _languageCode:String;

public function set languageCode(value:String):void
{
	_languageCode=value;
}

[Bindable]
public function get languageCode():String
{
	return _languageCode;
}

[Bindable]
public var localizator:Localizator=Localizator.getInstance();

private function changeLang(languageCode:String):void
{
	if (languageCode == "en")
	{
		localizator.language="en_US";
	}
	else if (languageCode == "gb")
	{
		localizator.language="zh_CN";
	}
	else if (languageCode == "tw")
	{
		localizator.language="zh_HK";
	}
	else
	{
		localizator.language="en_US";
	}
}
